<!doctype html>
<html>
<head>

    <meta charset="utf-8">
    <title>登陆成功 正在跳转</title>
    <style >
        body {background-color:#daf1fd;
        }
        div{font-size: 25px;

            color: #0f88eb;
            /*position:absolute;

             top:40%;

               left:50%;

             -webkit-transform:translate(-50%,-50%);

              -moz-transform:？(-50%,-50%);

              transform:？(-50%,-50%); */
        }
    </style>

    <script src="jquery-3.2.1.js"></script>
    <script type="text/javascript">
            $(document).ready(function() {
                $.ajax({

                    url: "http://v.juhe.cn/joke/randJoke.php?key=d6be0cc0d626b62a790ddf00f64dc7e9",
                    type: 'GET',
                    dataType: "JSONP",
                    async: true,
                    jsonp: 'callback',
                    success: function (result) {
                        $("button").click(function () {
                            var joke= result.result[0].content +"<br><br>" + result.result[1].content + "<br><br>" +result.result[2].content+"<br><br>只能看三条噢 想看更多 重新登录叭";
                            $("button").after(joke);

                            // $("button").click(function () {
                           // var jokee= result.result[2].content;
                           // $("button").after(jokee);})


                        });

                    }

                })

            });

                    function load(){
            var username=sessionStorage.key(sessionStorage.length);
            if(sessionStorage.length==0) {
                alert("请先登录");
                window.location.href = 'http://indianmifan.gitee.io/denglu';
            }
            else {
               var ming = document.getElementById("dengluming");
               ming.innerHTML=sessionStorage.getItem("username");
            }



            var list=document.getElementById("list");
            var result="<table border='1'align='center'>";
            result+="<tr><td>用户名</td><td>邮箱</td><td>密码</td><td>注册时间</td></tr>";
            for(var i=0;i<localStorage.length;i++) {
                var sitename = localStorage.key(i);
                var str = localStorage.getItem(sitename);

                if (typeof str === 'string') {
                    var site = JSON.parse(str)
                }
                result += "<tr><td>" + sitename + "</td><td>" + site.email + "</td><td>" + site.password + "</td><td>" + site.timenow +"</td></tr>";
            }
            result+="</table>";
            list.innerHTML=result;


        }
        function clear() {
            window.location.href='http://indianmifan.gitee.io/denglu';

        }

    </script>
    </head>
    <body>
    <div>
        <p>登陆成功 </p>

        <div id="dengluming" style="text-align:center;"></div>

        <div id="list" style="text-align:center;"></div>
       <button>震惊！点我竟然会出现......</button>

    <script>load()</script>
</body>
</html>